<template>
    <div>
        <button v-for="item in issn" @click="currentTab(item)">{{item}}</button>
        <div>
            <component :is="currentTabComponent"></component>
        </div>
    </div>
</template>

<script>
    import Case1 from "./tab/Case1";
    import Case2 from "./tab/Case2";
    import Case3 from "./tab/Case3";
    export default {
        name: "Case",
        data(){
            return{
                issn:['新闻1','新闻2','新闻3'],
                currentTabComponent:Case1
            }
        },
        methods:{
            currentTab(item){
                 // this.currentTabComponent = item
                if (item == '新闻1'){
                    this.currentTabComponent = Case1
                }else if (item == '新闻2'){
                    this.currentTabComponent = Case2
                }else if (item == '新闻3'){
                    this.currentTabComponent = Case3
                }
            }
        },
        components:{
            Case1,Case2,Case3,
        }
    }
</script>

<style scoped>

</style>